<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="css/muse-ui.css">
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
		<link rel="stylesheet" href="https://cdn.bootcss.com/material-design-icons/3.0.1/iconfont/material-icons.css">
		<link rel="stylesheet" href="css/muse-ui-loading.css">
		<link rel="stylesheet" href="https://at.alicdn.com/t/font_951857_sr7zod4vu4.css">
		<script src="js/vue.min.js"></script>
		<script src="js/muse-ui.js"></script>
		<script src="js/muse-ui-loading.js"></script>
		<script src="js/muse-ui-toast.js"></script>
		<script src="js/axios.min.js"></script>
		<script src="js/mui.min.js"></script>
		<script src="js/utils.js"></script>
		<style>
			.container{
				height:calc(100vh);
				width: 100%;
				padding: 20px;
			}
			.container input {
				color: #ff4081;
			}
			.login-head{
				margin-top: 20%;
				width: 100%;
				text-align: center;
			}
			.icon-denglu{
				color: #fff;
				font-size: 70px;
			}
		</style>
	</head>
	<body>
		<div id="body">
			<mu-appbar style="width: 100%;position: fixed;top: 0;padding-top: 20px;height: auto;" color="primary">
				<mu-button icon slot="left" @click="util.back()">
					<mu-icon value="arrow_back"></mu-icon>
				</mu-button>
				安全检查填写
			</mu-appbar>
			<mu-container style="padding-top: 76px;">
				<div v-for="(item,index) in checkTaskFieldList" :key="index">
					<div style="font-weight: bold;margin-top: 15px;" v-if="item.type=='标题'">{{item.field}}</div>
					<div v-else style="line-height: 30px;">{{item.field}}</div>
					<mu-text-field v-model="item.value" full-width v-if="item.type=='文本'" placeholder="请填写" color="primary" multi-line :rows="2" :rows-max="4"></mu-text-field><br/>
					<div v-if="item.type=='单选框'">
						<mu-radio v-model="item.value" :value="tmp" :label="tmp" v-for="(tmp,index) in item.typeValue.split(',')" style="margin-left: 15px;"></mu-radio>
					</div>
				</div>
				<mu-button @click="goSign()" color="primary" full-width style="margin-bottom: 30px;">下一步</mu-button>
			</mu-container>
		</div>
	</body>
	<script type="text/javascript">
		var vm = new Vue({
			el: "#body",
			data() {
				return {
					checkTaskFieldList:[]
				}
			},
			methods: {
				goSign(){
					var flag = true;
					this.checkTaskFieldList.forEach(item=>{
						if(item.value==undefined&&item.type!='标题'){
							flag = false;
							return;
						}
					})
					if(!flag){
						util.tip("还有检查项未填写!")
						return;
					}
					var task = {
						checktaskWorkerId: util.getData("checktaskWorkerId"),
						checkTaskFieldList:this.checkTaskFieldList
					}
					util.setData("safeCheck",task)
					util.openWindow("draw_user.html")
				},
				getCheckTaskField(){
					var params = {
						checkTaskId: util.getData("checkTaskId")
					}
					util.ajax("/api/method/getCheckTaskField", params, data => {
						this.checkTaskFieldList = data.object;
					})
				}
			}
		})
		document.addEventListener('plusready', function() {
			plus.screen.lockOrientation("portrait")
			vm.getCheckTaskField()
		});
	</script>
</html>
